<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>添加</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <script src="../../../../lib/include.js"></script>
    <link rel="stylesheet" href="../../../../../../public-tools/pc/plugins/diyUpload/diyUpload.css">

    <style>
        .form-control{margin-bottom: 8px;}
        .form-control:focus,
        .single-line:focus { border-color: #0e9aef !important;}
        .radio-inline {line-height: 5px;}
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content" id="app" v-cloak>

    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <form id="Form" autocomplete="off">
                <div style="padding: 0">
                    <input type="hidden" name="id">
                    <input type="hidden" name="version" value="0">
                    <div class="col-sm-12 form-group">
                        <div class="form-group col-sm-6">
                            <label class="orm-inline">名称</label>
                            <input type="text" class="form-control" name="name" v-model="info.name" placeholder="请输入名称">
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="orm-inline">价格</label>
                            <input class="form-control" type="text" name="param" v-model="info.param" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')"
                                   placeholder="请输入价格">
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="orm-inline">状态</label>
                            <select class="form-control" name="status" v-model="info.status">
                                <option value="1">启用</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="orm-inline">排序</label>
                            <input type="number" class="form-control" value="100" name="sort" v-model="info.sort" placeholder="请输入排序（数字大的排在前面）">
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="orm-inline">选择模板</label>
                            <select class="form-control" name="paramTemplateId" v-model="info.paramTemplateId" @change="changeParamTemplate()">
                                <option v-for="(item,index) in paramTemplateList" :value="item.id">{{item.name}}</option>
                            </select>
                        </div>
                    </div>
                    <!--配置参数模板相关-->
                    <div class="col-sm-12 " v-if="paramList.length>0">
                        <div class="panel panel-default">
                            <div class="panel-heading" @click="getParams()">
                                <h3 class="panel-title">参数模板配置 <span style="color: red"></span> </h3>
                            </div>
                            <div class="panel-body">
                                <div v-for="(item,index) in paramList" class="alert alert-warning alert-dismissible" role="alert" style="width: 100%;margin-right: 15px;display: inline-block;padding: 10px 35px 10px 10px">
                                    <!--<button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>-->
                                    <div class="input-group">
                                        <div class="input-group-addon">{{item.paramName}}</div>
                                        <input class="form-control" type="text" v-model="item.paramInfo" placeholder="请输入参数">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group" style="margin-top: 10px" id="files">
                        <label class="form-inline">详情图片（传两张）<font style="color: red">尺寸：【360 * 220】</font></label>
                        <div class="file-uploadImgs">
                            <div style="padding: 20px;">
                                <ul class="upload-ul clearfix">
                                    <li class="upload-pick">
                                        <div class="webuploader-container clearfix" id="uploadImgs">
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>

                <div style="text-align: center">
                    <a href="javascript:parent.layer.closeAll();" class="btn btn-default" style="width: 10%;">关 闭</a>
                    <button type="submit" class="btn btn-primary" style="width: 10%;" v-if="permission(0)" >保存</button>
                    <button type="submit" class="btn btn-primary" style="width: 10%;" v-else="permission(1)" >保存</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="../../../../../../public-tools/pc/plugins/diyUpload/webuploader.min.js"></script>
<script src="../../../../../../public-tools/pc/plugins/diyUpload/diyUpload.js"></script>
<script src="../../../../js/content-manage/goods/goodsSpec/edit.js"></script>
</body>
</html>
